﻿using System;
using System.Collections.Generic;
using System.Text;
using OpenGameEngine.GameObjects;
using OpenGameEngine.Drawing;
using System.IO;
using OpenGameEngine;

namespace ChopperGame
{
    public class Cloud : GameRectangle
    {
        private static Bitmap CloudImage;

        public Boolean Started { get; set; }

        public Cloud(float x, float y)
        {
            this.Position = new Vector2(x, y);
            Size = new SizeF();
            Enabled = true;
        }

        public override void Load(OpenGameEngine.Base.GameCoreEventArgs e)
        {
            base.Load(e);

            if (CloudImage == null)
                using (FileStream fs = File.OpenRead("Assets\\Cloud.png"))
                    CloudImage = Bitmap.LoadFromStream(fs);

            Size = CloudImage.Size;
        }

        public override void Draw(OpenGameEngine.Base.DrawEventArgs e)
        {
            base.Draw(e);

            e.DrawImage(CloudImage, this);
        }
    }
}
